package com.fillifesoft.magicHitter.manager;

public class ResourceManager {

	private static ResourceManager resourceManager = new ResourceManager();
	private SessionManager sessionManager = null;
	
	private ResourceManager() {}
	
	public static ResourceManager getInstance() {
		return resourceManager;
	}
	
	public SessionManager getSessionManager() {
		if(sessionManager == null) {
			sessionManager = new SessionManager();
		}
		return sessionManager;
	}
	
	public void close() {
		if(sessionManager != null && sessionManager.getSqlSession() != null) {
			sessionManager.getSqlSession().close();
		}
	}
}
